﻿using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.DTO;
using DXApplicationTangche.service;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.Utils
{
    public class ImageUtil
    {
        public String fileIOStream { get; set; }
        public Image image { get; set; }

        public ImageUtil(String fileIOStream, Image image) {
            this.fileIOStream = fileIOStream;
            this.image = image;
        }
        /// <summary>
        /// 根据样衣图片路径返回样衣图片
        /// </summary>
        /// <param name="sampleImagePath"></param>
        /// <returns></returns>
        public static Image UrlPathToImage(String sampleImagePath)
        {
            Image image返回;
            //根据样衣sampleImagePath返回image
            try
            {
                image返回 = FileService.GetImageByUrl(URL.图片url + URL.销售样衣实例图片路径 + sampleImagePath);
            }
            //如果样衣没有图片url，返回春衫logo
            catch
            {
                image返回 = FunctionHelper.getSSHIRT();
            }
            return image返回;
        }
    }
}
